package com.zxd.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.zxd.model.Employee;
import com.zxd.service.IEmployeeService;
@Controller
public class EmployeeController {
	private IEmployeeService  employeeService;

	public IEmployeeService getEmployeeService() {
		return employeeService;
	}
	@Resource
	public void setEmployeeService(IEmployeeService employeeService) {
		this.employeeService = employeeService;
	}
	
	@RequestMapping(value={"/add"},method=RequestMethod.GET)
	public String add(){
		return "add";
	}
	@RequestMapping(value={"/add"},method=RequestMethod.POST)
	public String add(Employee employee){
		employeeService.addEmployee(employee);
		return "redirect:/shs/demo";
	}
}
